package com.dhcc.utils.mail;

import java.io.IOException;
import java.util.Properties;

public class MailSetting extends Properties {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5683322578904915550L;
	public static final MailSetting INSTANCE = new MailSetting();
	private MailSetting() {
		try {
			this.load(getClass().getResourceAsStream("/mail.properties"));
		} catch (IOException e) {
			throw new RuntimeException("加载配置文件出错", e);
		}
	}
	public String getFrom() {
		return getProperty("sender.mail");
	}
	
	public String getFromName() {
		return getProperty("sender.name");
	}
	public String getUser() {
		return getProperty("sender.user", getFrom());
	}
	public String getPwd() {
		return getProperty("sender.pwd");
	}
}
